<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提交问题</title>
<script language="JavaScript" src="http://www.google.com/jsapi"></script>
<script>
	google.load("jquery","1.2.6");
</script>
<script language="JavaScript" src="./js/core.js"></script>
<script>
	$(function(){
		$("#btnSubmit").click(function(){
			var _data = "question=" + nehnre.encode($("#question").val());
			this.disabled = true;
			_data += "&answer=" + nehnre.encode($("#answer").val());
			$.ajax({
				url:"question_init.jsp",
				data:_data,
				type:"POST",
				cache:false,
				success:function(result){
					result = nehnre.parseJSON(result);
					if(result.success){
						$("#btnSubmit").attr("disabled",false);
						$("#question").val("");
						$("#answer").val("");
						alert("提交成功");
						$("#question").focus();
					}
				}
			});
		});
	});
</script>
</head>

<body>
<form>
	<div><label for="question">问题：</label><input type="text" name="question" id="question" size="100"/></div>
	<div><label for="answer">答案：</label><textarea id="answer" name="answer" id="answer" rows="25" cols="100"></textarea></div>
	<div><input type="button" value="提交" id="btnSubmit"/></div>
</form>
</body>
</html>
